#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <assert.h>

static double pow0(double x, int n) {
	double result = 1;
	for (int i = 0; i < n; i++)
		result *= x;
	return result;
}

static double pow(double x, int n) {
	double temp = x;
	double result = 1;
	while (n) {
		if (n % 2) {
			result *= temp;
		}
		n = n / 2;
		temp *= temp;
	}
	return result;
}

//_DS190718_pow
int main_DS190718_pow() {
	double x = 3;
	int n = 5;
	printf("%f\n", pow0(x, n));
	printf("%f\n", pow(x, n));
	return 0;
}